/*
 * Adapter.c
 *
 *  Created on: 2011-11-20
 *      Author: Jesse Meng [pingf0@gmail.com]
 */

#include"Adapter.h"
int Adapter_reload(Adapter *self,Adaptee *p){
	self->adaptee=p;
	return 0;
}
int Adapter_unload(Adapter *self,Adaptee *p){
	return DELETE0(p);
}
int Adapter_reloadSt(StAdapter *self,void *p){
	char * request(Adapter *self){
		return STT(self->adaptee,Adaptee)->doAction(self->adaptee);
	}
	self->request=(void *)request;
	int print(Adapter *self){
		printf("%s\n",STT(self,Adapter)->request(self));
		return 0;
	}
	self->print=(void *)print;
	return 0;
}
ASM(Adapter,Adapter_reload,NULL,Adapter_reloadSt,NULL)



